<%@ page language="java" import="java.util.*,com.king.cms.db.*,com.king.cms.common.*" pageEncoding="utf-8"%>
<%@ include file="/hotel/include/css.jsp"%><%-- /*包含css样式表*/ --%>
 <%
   int pow=3 | PowerParameter.amend | PowerParameter.first;
   QueryPage query = (QueryPage)request.getAttribute("data");
   String pageStr = ""; 
   List dataList=null;
   if( null != query){
	  pageStr = query.getPageStr(); 
	  if(query.getDataList() != null)
	     dataList=query.getDataList();
   }
 %> 
<html>
<head>
<title> </title>

<script language="javascript"> 
		var trKiobj;
		var clientId=null;
			function doEnable()
			{
				form1.bmMc.disabled=false;
				form1.bmBzrs.disabled=false;
			}
			function  ki_add()
			{
				window.open('<%=basePath%>tadmin/news.do?action=add','_self');
			}
			function ki_del(){
			if(confirm("确认删除所选新闻？"))
				form1.submit();
			}
			function ki_amend(){
			 var objs =   document.getElementsByName('newsId');
		         var checkIds = 0;
		         var newsId = '';
		         if(objs.length>0){
		            for(var i=0;i<objs.length;i++){
		                 if(objs[i].checked)
		                   checkIds++;
		            }        
		         }
		         if(checkIds >1){
		            alert('请选择一条记录进行修改');
		            return;
		         }
		         if(checkIds == 0){
		            alert('请选择	要修改的新闻');
		            return;
		         }
		         if(checkIds == 1){
		           for(var i=0;i<objs.length;i++){
		                 if(objs[i].checked)
		                   newsId = objs[i].value;
		            }   
		         }   
                  window.open('<%=basePath%>tadmin/news.do?action=modify&newsId='+newsId,'_self');
			 
			}
			function selmm(trobj,id)
			{
			
				if(trobj != null){
					deptid =id;
					if(trKiobj != null)
					   trKiobj.className='td3';
				     trobj.className='td1';
				}
			 trKiobj=trobj;
			} 
</script>
</head>

<body background="<%=imgpath%>top3.gif" leftmargin="0" topmargin="0">
<form name="form1" method="post" action="<%=basePath%>tadmin/news.do?action=del">
	<center>	
	<table border="0" cellpadding="0" cellspacing="0" width="100%" height="2">
    <tr>
      <td width="9" height="1">
      </td>
      <td  height="1" background="">
      <p align="center"><b>新闻管理</b></td>
      <td width="9" height="1">
      </td>
    </tr>
    </table>

	<table border="0" cellpadding="0" cellspacing="0" width="80%" height="1">
		<tr>
		  <td height="3">
		  </td>
		</tr>
	</table>       
	<table height="48" border="0" cellpadding="2" cellspacing="1" class="bg_table" style="width:90%" bordercolor="#111111">
	   <tr class="top_td"> 
    <td width="5%">序号</td>
    <td width="5%">操作</td>
    <td width="50%">新闻标题</td>
    <td width="20%">发布日期</td>
    <td width="20%">发布人</td>
  
  </tr>
 <%if(dataList != null && dataList.size()>0){
        for(int i=0;i<dataList.size();i++){
                 Map m = (Map)dataList.get(i);
    %>
  <tr <%if(i%2==1){%> class="td2" onMouseOver="this.className='td5'" onMouseOut="this.className='td2'"<%} else {%>class="td3" onMouseOver="this.className='td5'" onMouseOut="this.className='td3'" <%}%> onclick="selmm(this,<%if(m.get("ID") != null) out.print(m.get("ID")); %>)" onMouseOver="this.className='td5'" onMouseOut=" ">
    <td><%=(query.getCurrentPageNo()-1)*10+(i+1) %></td>
    <td><input type="checkbox" name="newsId" value="<%=m.get("ID") %>"></td>
    <td align="left"><%=StringUtil.NULL2Blank(m.get("NEWS_TITLE")+"") %></td>
    <td><%=StringUtil.NULL2Blank(m.get("PUBLISH_DATE") +"")%></td> 
     <td><%if(StringUtil.NULL2Blank(m.get("USER_NAME") +"").equals("")){out.print("超级管理员");}else{StringUtil.NULL2Blank(m.get("USER_NAME") +"");}%></td> 
 
  </tr>
    <%}} else{ %>
    <tr class="td2"> 
		<td colspan="10" align="center"><font color="red">没有新闻记录</font></td>
	  </tr>
    <%} %>
 </form>
	   <tr class="top_td"> 
		<td colspan="10"><%=pageStr %></td>
	  </tr>

     </table>
  </center>


</body>
</html>
<%@ include file="/hotel/pow.jsp"%>
